package com.jt.config;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.stereotype.Controller;
import org.springframework.context.annotation.FilterType;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/*
 * springmvc
 */
//@Configuration

@ComponentScan(value = "com.jt", includeFilters = {
		@Filter(type = FilterType.ANNOTATION, classes = { Controller.class }) },
		// 意思是扫描包com.jt下带有Controller注解的类，并为其创建对象
		useDefaultFilters = false) // 关闭默认扫描，默认是扫描com.jt下所有的，
@EnableWebMvc // 启用MVC的默认配置
public class AppServletConfig extends WebMvcConfigurerAdapter {
	public AppServletConfig() {
		System.out.println("AppServletConfig()");
	}

	@Override
	public void configureViewResolvers(ViewResolverRegistry registry) {
		registry.jsp("/WEB-INF/pages/", ".html");

	}

}
